package com.example.leetdemo.finash;


public class Solution1413 {

    public int minStartValue(int[] nums) {
        int count = 0;
        int num = 0;
        for (int i = 0; i < nums.length; i++) {
            count += nums[i];
            if (count < 1) {
                num += 1 - count;
                count = 1;
            }
        }
        return count;
    }

}
